import request from '@/router/axios';

// 获取全部列表
export const getAllOrder = () => {
    return request({
        url: 'http://localhost:3001/all',
        method: 'get',
    })
}

// 搜索
export const search = (name) => {
    return request({
        url: 'http://localhost:3001/search',
        method: 'post',
        params: {
            name
        }
    })
}

// 新增
export const addOrder = (row) => {
    return request({
        url: 'http://localhost:3001/add',
        method: 'post',
        data: row
    })
}

// 修改订单
export const updateOrder = (row) => {
    return request({
        url: 'http://localhost:3001/update',
        method: 'post',
        data: row
    })
}

// 删除 单个
export const removeOrder = (ids) => {
    return request({
        url: 'http://localhost:3001/remove',
        method: 'post',
        params: {
            ids
        }
    })
}

// 删除 多个
export const dropOrder = (ids) => {
    return request({
        url: 'http://localhost:3001/drop',
        method: 'post',
        params: {
            ids
        }
    })
}